package homework_04;

/**
 * 寻找MAX及其下标
 */
public class Test_03 {
    public static void main(String[] args) {
        int[] arr = {18,25,7,36,13,2,89,63};
        int num = arrMax(arr);
        System.out.println(num + "," + arr[num]);
    }

    public static int arrMax(int[] arr){
        int n = 0;
        int m = 0;
        for(int i=0;i<arr.length;i++){
            if(n<arr[i]){
                n = arr[i];
                m = i;
            }
        }
        return m;
    }
}
